import java.util.Scanner;
public class 第一题{
    public static void main(String[] args) {
        Scanner reader=new Scanner(System.in);
        System.out.println("请输入小王的性别"+"\n"+"请输入小张的性别");
        String xwGender= reader.next();
        String xzGender=reader.next();
        if(xzGender.equals(xwGender)){
            System.out.println("对不起，你们不可以结婚");
        }else{
            System.out.println("恭喜，你们可以结婚");
        }
        System.out.println("程序结束");
    }
}


import java.util.Scanner;
public class 第二题{
    public static void main(String[] args) {
    Scanner yh =new Scanner(System.in);
        System.out.println("请输入用户名");
        String name= yh.next();
        System.out.println("请输入密码");
        String upass= yh.next();
        System.out.println("请再次输入密码");
        String repass= yh.next();
        if (upass.equals(repass)){
            System.out.println("恭喜你，注册成功");
        }else {
            System.out.println("对不起，您两次输入的密码不一致，请重新输入");
        }
    }

}


import java.util.Scanner;

public class 第三题{
    public static void main(String[] args) {
        int num1,sum;
        int num2=20;
        Scanner TBcx = new Scanner(System.in);
        System.out.println("请输入本次购物价格");
        num1=TBcx.nextInt();
        System.out.println("亲，包邮吗？" + "\n"+"1.yes" +"\n"+ "2.no");
        System.out.println("请输入你的选择");
        Long 选择 = TBcx.nextLong();
        if (选择 == 1) {
            System.out.println("您此次一共花费=" +num1 );
        } else {
            sum=num1+num2;
            System.out.println("您此次一共花费=" + sum);
        }
        System.out.println("谢谢惠顾");
    }
}




import java.util.Scanner;

public class 第四题 {
    public static void main(String[] args) {
        int num1;
        int num2=10,num3=20,num4=50,num5=100;
        Scanner WG=new Scanner(System.in);
        System.out.println("请输入网购金额");
        num1=WG.nextInt();
        System.out.println("请输入客户与发货点之间的距离(公里数）");
        int GL=WG.nextInt();
        if((GL>=0)&&(GL<=10)){
            double s=num1+num2;
            System.out.println("您一共需要缴纳"+" "+s);
        }else if((GL>=11)&&(GL<=50)){
            double a=num1+num3;
            System.out.println("您一共需要缴纳"+" "+a);
        }else if((GL>=51)&&(GL<=100)){
            double b=num1+num4;
            System.out.println("您一共需要缴纳"+" "+b);
        }else if (GL>100){
            double c=num1+num5;
            System.out.println("您一共需要缴纳"+" "+c);
        }
        System.out.println("欢迎您的再次使用");
    }
}



package com.company作业;

import java.util.Scanner;

public class 第五题 {
    public static void main(String[] args) {
        Scanner XS=new Scanner(System.in);
        System.out.println("请输入学生的成绩分数");
        int CJ=XS.nextInt();
        if ((CJ>=0)&&(CJ<=59)){
            System.out.println("该学生所属的成绩等级为C");
        }else if((CJ>=60)&&(CJ<=80)){
            System.out.println("该学生所属的成绩等级为B");
        }else if((CJ>=81)&&(CJ<=100)){
            System.out.println("该学生所属的成绩等级为A");
        }else if((CJ<0)||(CJ>100)){
            System.out.println("成绩输入有误，请重新输入");
        }
    }
}




package com.company作业;

import java.util.Scanner;

public class 第六题 {
    public static void main(String[] args) {
        int a,b;
        Scanner in=new Scanner(System.in);
        System.out.println("是否为本超市会员");
        String HY=in.next();
        System.out.println("请输入商品总价");
        double JE=in.nextInt();
        if (HY.equals("是")&&(JE>=100)){
            System.out.println("折扣额"+JE*0.2+"最终要付款"+JE*0.8);
        }else if((HY.equals("是"))&&(JE<100)){
            System.out.println("折扣额"+JE*0.1+"最终要付款"+JE*0.9);
        }else if((HY.equals("不是"))&&(JE>=100)){
            System.out.println("折扣额"+JE*0.1+"最终要付款"+JE*0.9);
        }else if(HY.equals("不是")&&(JE<100)){
            System.out.println("折扣额"+JE);
        }
    }
}


package com.company作业;

public class 第七题 {
    public static void main(String[] args) {

        int[] is={10,5,20};
        int temp;
        for (int i = 0; i < is.length; i++) {
            for (int j = i+1; j < is.length; j++) {
                if (is[i] > is[j]) {
                    temp = is[i]; is[i] = is[j]; is[j] = temp;
                }
            }
        }
        for (int i = 0; i < is.length; i++) {
            System.out.print(is[i]+" ");
        }
    }
}